package net.googlecode.myshenko.Task4;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * Calculator of user defined date
 *
 * @author Vitalii Myshenko <a href="mailto:vitalii.myshenko@gmail.com">
 *
 * @since 5.04.11
 */
public class DateFormater {

    /**
     * Shift date
     *
     * @param shift define number of days to be added to current date
     *
     * @return changed date
     */
    public String calculateDate(int shift) {
        SimpleDateFormat sDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, shift);
        return sDateFormat.format(calendar.getTime());
    }
}
